//自定义对象
var user = {
    name: "Tom",
    age: 10,
    gender: "male",
    /* eat: function() {
        alert("eat!");
    } */
    eat() {
        alert("eat!");
    }
}
alert(user.name);
user.eat();